<!--
*@Author: QWP
*@Description: 标签页菜单的右键菜单
*@Date: 2023-07-25 14:48:03
-->
<template>
  <div v-bind="$attrs" class="u-common-right-menu">
    <div v-for="item in data"
      :key="item.id"
      @click="rightClick(item)">
      {{ item.label }}
    </div>
  </div>
</template>
<script>
export default {
  name: 'u-right-menu',
  props: {
    data: {
      type: Array,
      default: () => {
        return [{id: '0', label: "关闭当前页签"}, {id: '1', label: '关闭其他页签'}, {id: '2', label: '关闭全部页签'}]
      }
    }
  },
  data () {
    return {}
  },
  mounted() {},
  methods: {
    rightClick(data) {
      this.$emit('click', data)
    }
  }
}
</script>
<style lang='scss'>
.u-common-right-menu {
  position: absolute;
  z-index: 3000;
  padding: 4px 0px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0px 0px 2px 0px #333;
  div {
    padding: 8px 30px;
    cursor: pointer;
    font-size: 12px;
    &:hover {
      background: rgba(128, 128, 128, 0.3);
    }
    &:nth-child(1) {
      border-bottom: 2px solid #eee;
    }
  }
}
</style>